<template>

    <!-- 添加或修改对话框 -->
    <lam-dialog :title="title" :visible.sync="open" width="75%" append-to-body @close="cancel" custom-class="el-dialog-n">
      <!-- 操作按钮区域 -->
      <div class="tool-bar-btn" style="text-align: right;">
          <el-button type="primary" icon="el-icon-refresh" @click="getList">刷新</el-button>
      </div>
      <el-table ref="dataTable" v-loading="loading" :data="dataList" stripe border max-height="590">
        <el-table-column label="序号" align="center" type="index" width="60" fixed="left"/>
        <el-table-column label="实例IP" align="center" prop="instanceIp" width="120" fixed="left"/>
        <el-table-column label="触发器状态" align="center" prop="triggerStateDictText" width="120" fixed="left" :show-overflow-tooltip="true">
          <template slot-scope="{row}">
            <JobScheduleStatus :value="row.triggerState" :text="row.triggerStateDictText" />
          </template>
        </el-table-column>
        <el-table-column label="cron表达式" align="center" prop="cronExpression" width="150"/>
        <el-table-column label="调度时间" align="center" prop="schedTime" width="180"/>
        <el-table-column label="本次(预)触发时间" align="center" prop="firedTime" width="180"/>
        <el-table-column label="下一次触发时间" align="center" prop="nextFireTime" width="180"/>
        <el-table-column label="上一次触发时间" align="center" prop="prevFireTime" width="180"/>
        <el-table-column label="时区标识" align="center" prop="timeZoneId" width="120"/>
        <!-- <el-table-column label="触发器(jobId)" align="center" prop="triggerName" width="120"/> -->
        <!-- <el-table-column label="触发器组" align="center" prop="triggerGroup" width="120"/> -->
        <el-table-column label="并发类型" align="center" prop="nonconcurrentDictText" width="120"/>
        <el-table-column label="实例ID" align="center" prop="instanceId" width="250"/>
        <el-table-column label="执行器" align="center" prop="schedName" width="180"/>
        <!-- <el-table-column label="实例" align="center" prop="instanceName" width="320"/> -->
        <el-table-column label="触发器类型" align="center" prop="triggerType" width="120"/>
        <el-table-column label="优先级" align="center" prop="priority" width="80"/>
        <el-table-column label="触发器启动时间" align="center" prop="startTime" width="180"/>
        <!-- <el-table-column label="结束时间" align="center" prop="endTime" width="180"/> -->
      </el-table>

      <pagination v-show="!loading" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"  @pagination="getList" />

      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">关  闭</el-button>
      </div>
    </lam-dialog>

</template>

<script>
import { IndexListMixin } from '@/components/mixins/IndexListMixin';
import JobScheduleStatus from './JobScheduleStatus';

export default {
  name: "JobNodeDetail",
  mixins:[IndexListMixin],
  components:{
    JobScheduleStatus
  },
  data() {
    return {
      title: '',
      // 是否显示弹出层
      open: false,
      //是否使用排序
      useOrder: false,
      queryParams:{
        pageNum: 1,
        pageSize: 10
      },
      url: {
        nodeDetail: '/sched/job/nodeDetail/',
      },
      jobId: ''
    };
  },
  created() {
  },
  methods: {
    show(title, jobId){
      this.title = title;
      this.jobId = jobId;
      this.open = true;
      this.getList()
    },
    getList(){
      this.loadData(this.url.nodeDetail+this.jobId);
    },
    // 取消按钮
    cancel() {
      this.open = false;
    },

  }
};
</script>

<style scoped>
  .el-dialog-n .el-dialog__body {
      padding: 20px !important;
  }
</style>
